﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Sys.WebRes.Data;

namespace Sys.WebRes.Publish.Areas.Admin.Controllers
{
    public class BaseController : Controller
    {
        public User LoginUser { get; set; }

        public BaseController()
        {
            using (var db = DB.New)
            {
                var admin = db.AdminTBL.FirstOrDefault(p => p.LoginCode == "admin");
                admin.UserReference.Load();
                this.LoginUser = admin.User;
            }
        }

        protected ViewResult View(object model)
        {
            this.ModelState.Clear();
            return base.View(model);
        }
    }
}
